home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / gofer221.zip / RANDOM < prev    next >
Text File  |  1991-11-20  |  317b  |  12 lines

  1. -- Generate a list of random numbers of length n
  2.  
  3. randoms :: Int -> [Int]
  4. randoms  = iterate (\seed-> (77*seed+1) `rem` 1024)
  5.  
  6. rand100  = sort (take 100 (randoms 1000))   -- a sample distribution
  7.  
  8. adjs []  = []                    -- a list of pairs of adjacent
  9. adjs xs  = zip xs (tail xs)            -- elements in a list
  10.  
  11.  
  12.